package com.example.shardingSphere.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.shardingSphere.base.AbstractService;
import com.example.shardingSphere.base.BasicMapper;
import com.example.shardingSphere.dao.User2Mapper;
import com.example.shardingSphere.entity.UserInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: Breet
 * @Date: 2019/7/10 11:43
 * @Description:
 */
@Service
public class UserInfo2Service extends AbstractService<User2Mapper, UserInfo> {

    @Resource
    private User2Mapper user2Mapper;

    public BasicMapper getBaseMapper() {
        return user2Mapper;
    }


    public List<UserInfo> ge() {
        LambdaQueryWrapper<UserInfo> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.ge(UserInfo::getAge, "5")
                .orderByDesc(UserInfo::getId);
        return getBaseMapper().selectList(queryWrapper);
    }


}
